import service from './RequestUtil'

module.exports = {
  //系统管理
  addDepartment(item) { //建部门数据
    service.add('system-manage', 'name', item)
  },
  getDepartment() { //部门数据查询
    return service.allData('system-manage');
  },
  editDepartment(item, No) { //修改部门数据
    service.edit('system-manage', item, No);
  },
  deleteDepartment(Nolist) { //delete 部门数据
    service.delete('system-manage', Nolist);
  },
  addUserInfo(model) { //建用户信息
    service.add('user-manage', 'telephoneNo', model);
  },
  getUserInfo() { //获取员工信息
    return service.allData('user-manage');
  },
  editUserInfo(item, No) { //提交修改用户信息
    service.edit('user-manage', item, No);
  },
  deleteUserInfo(Nolist) { //提交修改用户信息
    service.delete('user-manage', Nolist);
  },
  //参数
  getBrandInfo() { //params 品牌
    return service.allData('brandList');
  },
  addBrandInfo(item) { //添加手机品牌信息
    service.add('brandList', 'brandName', item);
  },
  deleteBrandInfo(NoList) { //删除手机品牌信息
    service.delete('brandList', NoList);
  },
  getModelByBrandId(arr) { //根据条件查询型号数据
    return service.select('model-list', arr);
  },
  addModelInfo(item) { //添加手机型号信息 item:{}
    service.add('model-list', 'modelName', item);
  },
  deleteModelByNo(MNo, No) { //删除手机型号信息 MNo:str,No:str
    service.deleteByNO('model-list', MNo, No);
  },
  getModelColors(arr) { //获取机型颜色 [{ key:val}]
    return service.select('model-color-list', arr);
  },
  addMColorInfo(item) { //add model color; item:{}
    service.add('model-color-list', 'colorName', item);
  },
  deleteMColorInfo(NoList) { //delete model color; NoList:[1]
    service.delete('model-color-list', NoList);
  },
  getMFlats() { //获取机器故障 [{ key:val}]
    return service.allData('model-flates-list');
  },
  addModelFlate(item) { //add model flate; item:{}
    service.add('model-flates-list', 'mainTypeName', item);
  },
  deleteFlate(NoList) { //delete model flate; NoList:[1]
    service.delete('model-flates-list', NoList);
  },
  getFlateDetail(arr) { //获取故障详情根据-故障
    return service.select('flate-Detail-list', arr);
  },
  deleteFlateDetail(NoList) { //删除故障详情
    service.delete('flate-Detail-list', NoList);
  },
  addFlateDetail(item) { //添加故障描述
    service.add('flate-Detail-list', 'subTypeShotName', item)
  },
  //仓库
  addWarehouseManage(item) { //采购商品
    service.add('warehouse-manage', 'No', item);
  },
  getWarehouseManage(arr) { //根据条件查询仓库数据，[{ key:val}]
    return service.select('warehouse-manage', arr);
  },
  getAllWarehouse() { //没条件查询仓库
    return service.allData('warehouse-manage');
  },
  setStatusWarehouse(item, No) { //审核数据
    return service.edit('warehouse-manage', item, No);
  },
  addApplication(item) { //物料申请
    service.add('appliction-message', 'No', item);
  },
  getApplication(arr) { // 获取申请物料单 [{ key:val}]
    return service.select('appliction-message', arr);
  },
  getApplicationExamine(item, No) { //没条件查询仓库
    return service.edit('appliction-message', item, No);
  },
  //维修师
  addEngieerManage(item) { //新增
    service.add('engineer-manage', 'phone', item);
  },
  getAllEngieer() { //全部
    return service.allData('engineer-manage');
  },
  getEngieer(arr) { //条件查询 name 或 phone
    return service.select('engineer-manage', arr);
  },
  editEngieerInfo(item, No) { //修改
    return service.edit('engineer-manage', item, No);
  },
  deleteEngieerInfo(Nolist) { //delete engieer [No]
    service.delete('engineer-manage', Nolist);
  },
  // 订单
  // addOrderInfo(item) { //增加
  //   service.add('order-manage', 'phoneNo', item);
  // },
  addOrderInfo(item) { //增加
    service.addOne('order-manage', 'phoneNo', item);
  },
  getOnOrderDetail(arr) { //根据
    return service.select('order-manage', arr);
  },
  EditOneOrderInfo(item, No) { //修改订单
    return service.edit('order-manage', item, No);
  },
  getAllOrderList() { // all data order
    return service.allData('order-manage');
  },
  getAllBrandlist() { //获取手机品牌
    return service.allData('brandList');
  },
  //当月数据
  getToMonthNumber(No) {
    return service.echarts(No);
  },
  //当月返修
  getRreworkNumber() {
    return service.echReork();
  }
}
